home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / test / result.ok < prev    next >
Encoding:
Text File  |  1997-08-18  |  42.1 KB  |  1,324 lines  |  [TEXT/R*ch]

  1. Moscow ML version 1.42 (July 1997)
  2. Enter `quit();' to quit.
  3. [opening file "test.sml"]
  4. [opening file "test1.sml"]
  5. > val it = 1 : int
  6. > val it = 5 : int
  7. > val it = 100 : int
  8. > val fact = fn : int -> int
  9. > val it = 24 : int
  10. > val append2 = fn : 'a list * 'a list -> 'a list
  11. > val it = [1, 2, 3, 4, 5, 6] : int list
  12. > val append = fn : 'a list -> ('a list -> 'a list)
  13. > val it = [1, 2, 3, 4, 5, 6] : int list
  14. > val reverse = fn : 'a list -> 'a list
  15. > val it = [4, 3, 2, 1] : int list
  16. > val it = [false, true] : bool list
  17. > val @ = fn : 'a list * 'a list -> 'a list
  18. > infixr 5 @
  19. > val it = [1, 2, 3, 4, 5, 6] : int list
  20. [closing file "test1.sml"]
  21. > val it = () : unit
  22. [opening file "test2.sml"]
  23. > val fact = fn : int -> int
  24. > val it = 24 : int
  25. > val append2 = fn : 'a list * 'a list -> 'a list
  26. > val it = [1, 2, 3, 4, 5, 6] : int list
  27. > val append = fn : 'a list -> 'a list -> 'a list
  28. > val it = [1, 2, 3, 4, 5, 6] : int list
  29. > val reverse = fn : 'a list -> 'a list
  30. > val it = [4, 3, 2, 1] : int list
  31. > val it = [false, true] : bool list
  32. > val @ = fn : 'a list * 'a list -> 'a list
  33. > infixr 5 @
  34. > val it = [1, 2, 3, 4, 5, 6] : int list
  35. [closing file "test2.sml"]
  36. > val it = () : unit
  37. [opening file "test3.sml"]
  38. > datatype 'a Tree
  39.   con Lf = Lf : 'a Tree
  40.   con Br = fn : 'a * 'a Tree * 'a Tree -> 'a Tree
  41. > val t1 = Br(2, Br(1, Lf, Lf), Br(3, Lf, Lf)) : int Tree
  42. > val foldTree = fn : ('a -> ('b -> ('b -> 'b))) -> 'b -> 'a Tree -> 'b
  43. > val revBranch = fn : 'a -> 'a Tree -> 'a Tree -> 'a Tree
  44. > val refl_t1 = Br(2, Br(3, Lf, Lf), Br(1, Lf, Lf)) : int Tree
  45. [closing file "test3.sml"]
  46. > val it = () : unit
  47. [opening file "test4.sml"]
  48. > val map = fn : ('a -> 'b) -> 'a list -> 'b list
  49. > val it = [2, 3, 4] : int list
  50. > infix 5 ++
  51. > val ++ = fn : 'a list * 'a list -> 'a list
  52. > val it = [1, 2, 3, 4, 5, 6] : int list
  53. > val reverse = fn : 'a list -> 'a list
  54. > val it = [4, 3, 2, 1] : int list
  55. > val it = [false, true] : bool list
  56. > infix 3 o
  57. > val o = fn : ('a -> 'b) * ('c -> 'a) -> 'c -> 'b
  58. > val it = [1, 2, 3] : int list
  59. > val zl = [(1, true), (2, false), (3, true)] : (int * bool) list
  60. > val fst = fn : 'a * 'b -> 'a
  61. > val snd = fn : 'a * 'b -> 'b
  62. > val it = [1, 2, 3] : int list
  63. > val split = fn : ('a * 'b) list -> 'a list * 'b list
  64. > val it = ([1, 2, 3], [true, false, true]) : int list * bool list
  65. > val member = fn : ''a -> ''a list -> bool
  66. > val it = true : bool
  67. > val it = false : bool
  68. [closing file "test4.sml"]
  69. > val it = () : unit
  70. [opening file "test5.sml"]
  71. > val it = [7] : int list
  72. > val Id = fn : 'a -> 'a
  73. > val Id' = fn : 'a -> 'a
  74. > val reverse = fn : 'a list -> 'a list
  75. > val it = [3, 2, 1] : int list
  76. > val it = [false, true] : bool list
  77. > val f = fn : int ref -> int ref * int
  78. > val it = (ref 666, 99) : int ref * int
  79. > val it = 8 : int
  80. [closing file "test5.sml"]
  81. > val it = () : unit
  82. [opening file "test6.sml"]
  83. > exn E = E : exn
  84. > val f = fn : unit -> 'a
  85. > val it = "OK" : string
  86. > val elist = [E, Size] : exn list
  87. > exn E' = E' : exn
  88. > val it = "OK" : string
  89. > val it = "OK" : string
  90. > exn G = fn : int -> exn
  91. > val it = "OK" : string
  92. [closing file "test6.sml"]
  93. > val it = () : unit
  94. [opening file "test7.sml"]
  95. > abstype 'a Stack
  96.   type 'a StackTop = 'a * 'a Stack
  97.   exn EmptyStack = EmptyStack : exn
  98.   val empty = <Stack> : 'a Stack
  99.   val top = fn : 'a Stack -> 'a
  100.   val push = fn : 'a -> 'a Stack -> 'a Stack
  101.   val pop = fn : 'a Stack -> 'a Stack
  102. > val st1 = <Stack> : int Stack
  103. > val top1 = 3 : int
  104. > val rest1 = <Stack> : int Stack
  105. [closing file "test7.sml"]
  106. > val it = () : unit
  107. [opening file "test8.sml"]
  108. > datatype 'a arex
  109.   type 'a binary = 'a arex * 'a arex
  110.   type 'a unary = 'a arex
  111.   con ADD = fn : 'a arex * 'a arex -> 'a arex
  112.   con SUB = fn : 'a arex * 'a arex -> 'a arex
  113.   con MINUS = fn : 'a arex -> 'a arex
  114.   con TIP = fn : 'a -> 'a arex
  115. > val a1 = MINUS(ADD(TIP 1, SUB(TIP 2, TIP 5))) : int arex
  116. [closing file "test8.sml"]
  117. > val it = () : unit
  118. [opening file "test9.sml"]
  119. > type person = {age : int, name : string}
  120. > val p1 = {age = 99, name = "Peter"} : {age : int, name : string}
  121. > val name1 = "Peter" : string
  122.   val age1 = 99 : int
  123. > val nameOfPerson = fn : {age : 'a, name : 'b} -> 'b
  124. > val name1 = "Peter" : string
  125. > val name = "Peter" : string
  126.   val age = 99 : int
  127. > val name = "Peter" : string
  128. > val name = "Peter" : string
  129.   val name1 = "Peter" : string
  130. > val f = fn : {age : int, name : string} -> string
  131. > val name1 = "Peter" : string
  132. > val age1 = 99 : int
  133. > val f = fn : {lab : int} -> int
  134. > val it =
  135.     fn
  136.     : 'a -> ({l1 : ''b, l2 : int} -> {l1 : ''b, l3 : string} -> bool) * bool
  137. (fn, true)> val it = () : unit
  138. > val it =
  139.     fn
  140.     : 'a ->
  141.       ({l1 : 'b, l2 : ''c} -> 'b) * ({l1 : 'd, l2 : 'e} -> 'd * 'e) *
  142.       ({l1 : ''f, l2 : ''g} -> bool * ''f * (''f * ''g))
  143. (fn, fn, fn)> val it = () : unit
  144. [closing file "test9.sml"]
  145. > val it = () : unit
  146. [opening file "testa.sml"]
  147. > val even = fn : int -> bool
  148.   val odd = fn : int -> bool
  149. > val it = true : bool
  150. > val it = false : bool
  151. > datatype 'a X
  152.   con X = fn : string -> 'a X
  153. > val stripX = fn : 'a X -> string
  154. > val it = fn : 'a -> string
  155. > val it = "OK" : string
  156. > val stripX666 = fn : 'a X -> 'a X
  157. > val it = fn : 'a -> 'b X
  158. > val it = X "000" : int X
  159. > val it = fn : 'a -> 'b X
  160. > val it = X "OK" : int X
  161. > datatype XXX
  162.   con A = fn : int * int -> XXX
  163.   con B = fn : int * int -> XXX
  164. > val a12 = A(1, 2) : XXX
  165.   val b12 = B(1, 2) : XXX
  166. > val strip = fn : XXX -> int * int
  167. > val it = false : bool
  168. > val it = true : bool
  169. [closing file "testa.sml"]
  170. > val it = () : unit
  171. [opening file "testb.sml"]
  172. File "testb.sml", line 3, characters 9-12:
  173. ! (let val nil = [1,2] and _ =
  174. !          ^^^
  175. ! Warning: pattern matching is not exhaustive
  176.  
  177. > val it = "OK" : string
  178. File "testb.sml", line 7, characters 2-17:
  179. ! ((fn 0 => "WRONG") 1)
  180. !   ^^^^^^^^^^^^^^^
  181. ! Warning: pattern matching is not exhaustive
  182.  
  183. > val it = "OK" : string
  184. > val it =
  185.     [{cause = Fail "OK", function = "OK", name = "OK"}]
  186.     : {cause : exn, function : string, name : string} list
  187. > val it =
  188.     ({cause = Fail "OK", function = "OK", name = "OK"},
  189.      {cause = Fail "OK", function = "OK", name = "OK"})
  190.     : {cause : exn, function : string, name : string} *
  191.       {cause : exn, function : string, name : string}
  192. > val it =
  193.     {aaa = {cause = Fail "OK", function = "OK", name = "OK"},
  194.      bbb = {cause = Fail "OK", function = "OK", name = "OK"}}
  195.     : {aaa : {cause : exn, function : string, name : string}, bbb :
  196.          {cause : exn, function : string, name : string}}
  197. > val pr = fn : string -> string
  198. > val x7 =
  199.     fn
  200.     : 'a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g ->
  201.       'a * 'b * 'c * 'd * 'e * 'f * 'g
  202. 246> val it =
  203.     ("1", "2", "3", "4", "5", "6", "7")
  204.     : string * string * string * string * string * string * string
  205. > datatype ('a, 'b) AB
  206.   con NILab = NILab : ('a, 'b) AB
  207.   con CONSab = fn : {a : 'a, b : 'b} -> ('a, 'b) AB
  208. ab> val it = CONSab{a = "a", b = "b"} : (string, string) AB
  209. ba> val it = CONSab{a = "a", b = "b"} : (string, string) AB
  210. > val f = fn : 'a -> 'a
  211. > val f = fn : int -> int
  212. > val it = "OK" : string
  213. [closing file "testb.sml"]
  214. > val it = () : unit
  215. [opening file "testc.sml"]
  216. > datatype xxx
  217.   con P = P : xxx
  218.   con Q = fn : {key : (xxx ref * xxx ref) list} -> xxx
  219. > val z = ref P : xxx ref
  220. > val it = () : unit
  221. > val it =
  222.     ref(Q{key =
  223.             [(ref(Q{key =
  224.                       [(ref(Q{key =
  225.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  226.                                   ref(Q{key = [(#, #), (#, #)]})),
  227.                                  (ref(Q{key = [(#, #), (#, #)]}),
  228.                                   ref(Q{key = [(#, #), (#, #)]}))]}),
  229.                         ref(Q{key =
  230.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  231.                                   ref(Q{key = [(#, #), (#, #)]})),
  232.                                  (ref(Q{key = [(#, #), (#, #)]}),
  233.                                   ref(Q{key = [(#, #), (#, #)]}))]})),
  234.                        (ref(Q{key =
  235.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  236.                                   ref(Q{key = [(#, #), (#, #)]})),
  237.                                  (ref(Q{key = [(#, #), (#, #)]}),
  238.                                   ref(Q{key = [(#, #), (#, #)]}))]}),
  239.                         ref(Q{key =
  240.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  241.                                   ref(Q{key = [(#, #), (#, #)]})),
  242.                                  (ref(Q{key = [(#, #), (#, #)]}),
  243.                                   ref(Q{key = [(#, #), (#, #)]}))]}))]}),
  244.               ref(Q{key =
  245.                       [(ref(Q{key =
  246.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  247.                                   ref(Q{key = [(#, #), (#, #)]})),
  248.                                  (ref(Q{key = [(#, #), (#, #)]}),
  249.                                   ref(Q{key = [(#, #), (#, #)]}))]}),
  250.                         ref(Q{key =
  251.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  252.                                   ref(Q{key = [(#, #), (#, #)]})),
  253.                                  (ref(Q{key = [(#, #), (#, #)]}),
  254.                                   ref(Q{key = [(#, #), (#, #)]}))]})),
  255.                        (ref(Q{key =
  256.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  257.                                   ref(Q{key = [(#, #), (#, #)]})),
  258.                                  (ref(Q{key = [(#, #), (#, #)]}),
  259.                                   ref(Q{key = [(#, #), (#, #)]}))]}),
  260.                         ref(Q{key =
  261.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  262.                                   ref(Q{key = [(#, #), (#, #)]})),
  263.                                  (ref(Q{key = [(#, #), (#, #)]}),
  264.                                   ref(Q{key = [(#, #), (#, #)]}))]}))]})),
  265.              (ref(Q{key =
  266.                       [(ref(Q{key =
  267.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  268.                                   ref(Q{key = [(#, #), (#, #)]})),
  269.                                  (ref(Q{key = [(#, #), (#, #)]}),
  270.                                   ref(Q{key = [(#, #), (#, #)]}))]}),
  271.                         ref(Q{key =
  272.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  273.                                   ref(Q{key = [(#, #), (#, #)]})),
  274.                                  (ref(Q{key = [(#, #), (#, #)]}),
  275.                                   ref(Q{key = [(#, #), (#, #)]}))]})),
  276.                        (ref(Q{key =
  277.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  278.                                   ref(Q{key = [(#, #), (#, #)]})),
  279.                                  (ref(Q{key = [(#, #), (#, #)]}),
  280.                                   ref(Q{key = [(#, #), (#, #)]}))]}),
  281.                         ref(Q{key =
  282.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  283.                                   ref(Q{key = [(#, #), (#, #)]})),
  284.                                  (ref(Q{key = [(#, #), (#, #)]}),
  285.                                   ref(Q{key = [(#, #), (#, #)]}))]}))]}),
  286.               ref(Q{key =
  287.                       [(ref(Q{key =
  288.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  289.                                   ref(Q{key = [(#, #), (#, #)]})),
  290.                                  (ref(Q{key = [(#, #), (#, #)]}),
  291.                                   ref(Q{key = [(#, #), (#, #)]}))]}),
  292.                         ref(Q{key =
  293.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  294.                                   ref(Q{key = [(#, #), (#, #)]})),
  295.                                  (ref(Q{key = [(#, #), (#, #)]}),
  296.                                   ref(Q{key = [(#, #), (#, #)]}))]})),
  297.                        (ref(Q{key =
  298.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  299.                                   ref(Q{key = [(#, #), (#, #)]})),
  300.                                  (ref(Q{key = [(#, #), (#, #)]}),
  301.                                   ref(Q{key = [(#, #), (#, #)]}))]}),
  302.                         ref(Q{key =
  303.                                 [(ref(Q{key = [(#, #), (#, #)]}),
  304.                                   ref(Q{key = [(#, #), (#, #)]})),
  305.                                  (ref(Q{key = [(#, #), (#, #)]}),
  306.                                   ref(Q{key = [(#, #), (#, #)]}))]}))]}))]})
  307.     : xxx ref
  308. [closing file "testc.sml"]
  309. > val it = () : unit
  310. [opening file "testd.sml"]
  311. > val maxint = 1073741823 : int
  312. > val minint = ~1073741824 : int
  313. > infix 0 seq
  314.   val seq = fn : 'a * 'b -> 'b
  315. > val it = "OK" : string
  316. > val it = "OK" : string
  317. > val it = "OK" : string
  318. > val it = "OK" : string
  319. > val it = "OK" : string
  320. > val it = "OK" : string
  321. > val it = "OK" : string
  322. > val sum = fn : int * int -> int
  323. > val diff = fn : int * int -> int
  324. > val it = "OK" : string
  325. > val it = "OK" : string
  326. > val it = "OK" : string
  327. > val prod = fn : int * int -> int
  328. > val it = "OK" : string
  329. > val checkDivMod = fn : int -> int -> string
  330. 23 10   > val it = "OK" : string
  331. ~23 10   > val it = "OK" : string
  332. 23 ~10   > val it = "OK" : string
  333. ~23 ~10   > val it = "OK" : string
  334. 100 10   > val it = "OK" : string
  335. ~100 10   > val it = "OK" : string
  336. 100 ~10   > val it = "OK" : string
  337. ~100 ~10   > val it = "OK" : string
  338. 100 1   > val it = "OK" : string
  339. 100 ~1   > val it = "OK" : string
  340. 0 1   > val it = "OK" : string
  341. 0 ~1   > val it = "OK" : string
  342. > val it = "OK" : string
  343. > val it = "OK" : string
  344. > val it = "OK" : string
  345. > val maxri = 1073741823.0 : real
  346. > val minri = ~1073741824.0 : real
  347. > val it = "OK" : string
  348. > val it = "OK" : string
  349. > val it = "OK" : string
  350. > val it = "OK" : string
  351. > val it = "OK" : string
  352. > val it = "OK" : string
  353. > val it = "OK" : string
  354. > val it = "OK" : string
  355. [closing file "testd.sml"]
  356. > val it = () : unit
  357. [opening file "teste.sml"]
  358. > val MAXDOUBLE = 8.98846567431E307 : real
  359. > val MINDOUBLE = 4.94065645841E~324 : real
  360.   val pi = 3.14159265359 : real
  361. > val eps = 1E~14 : real
  362. > infix 0 seq
  363.   val seq = fn : 'a * 'b -> 'b
  364. > val check1 = fn : ('a -> real) * 'a * real -> string
  365. > val it = "OK" : string
  366. > val it = "OK" : string
  367. > val it = "OK" : string
  368. > val it = "OK" : string
  369. > val it = "OK" : string
  370. > val it = "OK" : string
  371. > val check2 = fn : ('a * 'b -> real) * 'a * 'b * real -> string
  372. > val it = "OK" : string
  373. > val it = "OK" : string
  374. > val it = "OK" : string
  375. > val it = "OK" : string
  376. > val it = "OK" : string
  377. > val it = "OK" : string
  378. > val it = "OK" : string
  379. > val it = "OK" : string
  380. > val it = "OK" : string
  381. > val it = "OK" : string
  382. > val it = "OK" : string
  383. > val it = "OK" : string
  384. > val it = "OK" : string
  385. > val it = "OK" : string
  386. > val it = "OK" : string
  387. > val it = "OK" : string
  388. > val f = fn : real -> real
  389. [closing file "teste.sml"]
  390. > val it = () : unit
  391. [opening file "testprs.sml"]
  392. > datatype token
  393.   con Key = fn : string -> token
  394.   con Name = fn : string -> token
  395. > exn SynError = fn : string -> exn
  396. > val $ = fn : string -> token list -> string * token list
  397. > val id = fn : token list -> string * token list
  398. > infix 3 >>
  399. > val >> = fn : ('a -> 'b * 'c) * ('b -> 'd) -> 'a -> 'd * 'c
  400. > infix 0 ||
  401. > val || = fn : ('a -> 'b) * ('a -> 'b) -> 'a -> 'b
  402. > infix 5 ~~
  403. > val ~~ = fn : ('a -> 'b * 'c) * ('c -> 'd * 'e) -> 'a -> ('b * 'd) * 'e
  404. > val empty = fn : 'a -> 'b list * 'a
  405. > val many = fn : ('a -> 'b * 'a) -> 'a -> 'b list * 'a
  406. > val snd = fn : 'a * 'b -> 'b
  407. > val many_sep = fn : ('a -> 'b * 'c) -> ('c -> 'd * 'a) -> 'a -> 'b list * 'c
  408. > val parser = fn : ('a -> 'b * 'c list) -> 'a -> 'b
  409. > datatype typ
  410.   con Con = fn : string * typ list -> typ
  411.   con Var = fn : string -> typ
  412. > val parseTypeExp = fn : token list -> typ
  413. > val t1 = [Name "a", Key "->", Name "b", Key "->", Name "c"] : token list
  414. > val t2 =
  415.     [Key "(", Name "a", Key "->", Name "b", Key ")", Key "->", Name "c"]
  416.     : token list
  417. > val it = Con("->", [Var "a", Con("->", [Var "b", Var "c"])]) : typ
  418. > val it = Con("->", [Con("->", [Var "a", Var "b"]), Var "c"]) : typ
  419. [closing file "testprs.sml"]
  420. > val it = () : unit
  421. [opening file "ovlsucc.sml"]
  422. > type word8 = Word8.word
  423. > val iii1 = fn : int -> int -> int
  424. > val iii2 = fn : int -> int -> int
  425. > val iii3 = fn : int -> int -> int
  426. > val iii4 = fn : int -> int -> int
  427. > val iii5 = fn : int -> int -> int
  428. > val iii6 = fn : int -> int -> bool
  429. > val iib7 = fn : int -> int -> bool
  430. > val iib8 = fn : int -> int -> bool
  431. > val iib9 = fn : int -> int -> bool
  432. > val ii10 = fn : int -> int
  433. > val ii11 = fn : int -> int
  434. > val www1 = fn : word -> word -> word
  435. > val www2 = fn : word -> word -> word
  436. > val www3 = fn : word -> word -> word
  437. > val www4 = fn : word -> word -> word
  438. > val www5 = fn : word -> word -> word
  439. > val www6 = fn : word -> word -> bool
  440. > val wwb7 = fn : word -> word -> bool
  441. > val wwb8 = fn : word -> word -> bool
  442. > val wwb9 = fn : word -> word -> bool
  443. > val www1 = fn : Word8.word -> Word8.word -> Word8.word
  444. > val www2 = fn : Word8.word -> Word8.word -> Word8.word
  445. > val www3 = fn : Word8.word -> Word8.word -> Word8.word
  446. > val www4 = fn : Word8.word -> Word8.word -> Word8.word
  447. > val www5 = fn : Word8.word -> Word8.word -> Word8.word
  448. > val www6 = fn : Word8.word -> Word8.word -> bool
  449. > val wwb7 = fn : Word8.word -> Word8.word -> bool
  450. > val wwb8 = fn : Word8.word -> Word8.word -> bool
  451. > val wwb9 = fn : Word8.word -> Word8.word -> bool
  452. > val rrr1 = fn : real -> real -> real
  453. > val rrr2 = fn : real -> real -> real
  454. > val rrr3 = fn : real -> real -> real
  455. > val rrb4 = fn : real -> real -> bool
  456. > val rrb5 = fn : real -> real -> bool
  457. > val rrb6 = fn : real -> real -> bool
  458. > val rrb7 = fn : real -> real -> bool
  459. > val rr8 = fn : real -> real
  460. > val rr9 = fn : real -> real
  461. > val ssb1 = fn : string -> string -> bool
  462. > val ssb2 = fn : string -> string -> bool
  463. > val ssb3 = fn : string -> string -> bool
  464. > val ssb4 = fn : string -> string -> bool
  465. > val ccb1 = fn : char -> char -> bool
  466. > val ccb2 = fn : char -> char -> bool
  467. > val ccb3 = fn : char -> char -> bool
  468. > val ccb4 = fn : char -> char -> bool
  469. > val succ1 = fn : Word8.word -> Word8.word list
  470. > val succ2 = fn : word -> word list
  471. > val less = fn : int * int -> bool
  472.   val minii = fn : int * int -> int
  473. > val is12 = fn : int -> string
  474. > val ws10 = fn : word -> string
  475. > val ws10 = fn : Word8.word -> string
  476. > val rs10 = fn : real -> string
  477. > val ss5 = fn : string -> string
  478. > val cs5 = fn : char -> string
  479. > val eei1 = true : bool
  480. > val eew1 = true : bool
  481. > val eec1 = true : bool
  482. > val eeg1 = true : bool
  483. User: 3.500  System: 0.000  GC: 0.000  Real: 4.066
  484. > val it = 7 : int
  485. > val loop2 = fn : int -> int
  486. User: 3.380  System: 0.000  GC: 0.000  Real: 3.540
  487. > val it = 7 : int
  488. [closing file "ovlsucc.sml"]
  489. > val it = () : unit
  490. [opening file "constsuc.sml"]
  491. > val minInt1 = ~1073741824 : int
  492. > val maxInt1 = 1073741823 : int
  493. > val minInt2 = ~1073741824 : int
  494. > val maxInt21 = 1073741823 : int
  495. > val maxInt22 = 1073741823 : int
  496. > val test1 = true : bool
  497. > val test2 = true : bool
  498. > val maxWord1 = 0wx7FFFFFFF : word
  499. > val maxWord2 = 0wx7FFFFFFF : word
  500. > val test3 = true : bool
  501. > val maxWord8_1 = 0wxFF : word
  502. > val maxWord8_2 = 0wxFF : word
  503. > val test4 = true : bool
  504. [closing file "constsuc.sml"]
  505. > val it = () : unit
  506. [opening file "testmatc.sml"]
  507. > val check' = fn : (unit -> bool) -> string
  508. > val checkres1 = fn : ('a -> ''b) -> ('a * ''b) list -> string
  509.   val checkres2 = fn : ('a -> ('b -> ''c)) -> ('a * 'b * ''c) list -> string
  510. File "testmatc.sml", line 14-15, characters 4-56:
  511. ! ....f1 ([], [])       = 111 
  512. !   | f1 (x::xr, y::yr) = 222.........
  513. ! Warning: pattern matching is not exhaustive
  514.  
  515. > val f1 = fn : 'a list * 'b list -> int
  516. File "testmatc.sml", line 17-18, characters 4-60:
  517. ! ....f1c []      []      = 111 
  518. !   | f1c (x::xr) (y::yr) = 222.........
  519. ! Warning: pattern matching is not exhaustive
  520.  
  521. > val f1c = fn : 'a list -> 'b list -> int
  522. > val test1a = "OK" : string
  523. > val test1b = "OK" : string
  524.   val test1c = "OK" : string
  525.   val test2a = "OK" : string
  526. File "testmatc.sml", line 30-32, characters 4-84:
  527. ! ....f2 ([], [])       = 111 
  528. !   | f2 (x::xr, y::yr) = 222
  529. !   | f2 ([], [])       = 333.
  530. ! Warning: some cases are unused in this match.
  531.  
  532. File "testmatc.sml", line 30-32, characters 4-84:
  533. ! ....f2 ([], [])       = 111 
  534. !   | f2 (x::xr, y::yr) = 222
  535. !   | f2 ([], [])       = 333.
  536. ! Warning: pattern matching is not exhaustive
  537.  
  538. > val test2b = "OK" : string
  539.   val test2c = "OK" : string
  540.   val f2 = fn : 'a list * 'b list -> int
  541. File "testmatc.sml", line 34-36, characters 4-90:
  542. ! ....f2c []      []      = 111 
  543. !   | f2c (x::xr) (y::yr) = 222
  544. !   | f2c []      []      = 333.
  545. ! Warning: some cases are unused in this match.
  546.  
  547. File "testmatc.sml", line 34-36, characters 4-90:
  548. ! ....f2c []      []      = 111 
  549. !   | f2c (x::xr) (y::yr) = 222
  550. !   | f2c []      []      = 333.
  551. ! Warning: pattern matching is not exhaustive
  552.  
  553. > val f2c = fn : 'a list -> 'b list -> int
  554. > val test3a = "OK" : string
  555. > val test3b = "OK" : string
  556.   val test3c = "OK" : string
  557.   val test4a = "OK" : string
  558. > datatype 'a t
  559.   val test4b = "OK" : string
  560.   val test4c = "OK" : string
  561.   con Uniq = fn : 'a -> 'a t
  562.   val fc1 = fn : string t -> string
  563.   val test5 = "OK" : string
  564.   val berry = fn : bool * bool * bool -> int
  565. > val testberry = "OK" : string
  566. File "testmatc.sml", line 80-84, characters 4-154:
  567. ! ....fcon (A,   B, C [] ) = 111
  568. !   | fcon (A,   B, C [1]) = 222
  569. !   | fcon (B,   B, _    ) = 333
  570. !   | fcon (A,   A, A    ) = 444
  571. !   | fcon (C[], A, A    ) = 555.
  572. ! Warning: pattern matching is not exhaustive
  573.  
  574. > datatype t
  575.   con A = A : t
  576.   con B = B : t
  577.   con C = fn : int list -> t
  578.   val fcon = fn : t * t * t -> int
  579. > val test6a = "OK" : string
  580. > val test6b = "OK" : string
  581. > val test6c = "OK" : string
  582. > val test6d = "OK" : string
  583. File "testmatc.sml", line 106-110, characters 4-89:
  584. ! ....fi 101  = 111
  585. !   | fi 102  = 222
  586. !   | fi 101  = 333
  587. !   | fi 104  = 444
  588. !   | fi ~101 = 555.
  589. ! Warning: some cases are unused in this match.
  590.  
  591. File "testmatc.sml", line 106-110, characters 4-89:
  592. ! ....fi 101  = 111
  593. !   | fi 102  = 222
  594. !   | fi 101  = 333
  595. !   | fi 104  = 444
  596. !   | fi ~101 = 555.
  597. ! Warning: pattern matching is not exhaustive
  598.  
  599. > val fi = fn : int -> int
  600. > val test10a = "OK" : string
  601. File "testmatc.sml", line 117-120, characters 4-87:
  602. ! ....fs "first"  = 111
  603. !   | fs "second" = 222
  604. !   | fs "first"  = 333
  605. !   | fs "fourth" = 444.
  606. ! Warning: some cases are unused in this match.
  607.  
  608. File "testmatc.sml", line 117-120, characters 4-87:
  609. ! ....fs "first"  = 111
  610. !   | fs "second" = 222
  611. !   | fs "first"  = 333
  612. !   | fs "fourth" = 444.
  613. ! Warning: pattern matching is not exhaustive
  614.  
  615. > val test10b = "OK" : string
  616.   val test10c = "OK" : string
  617.   val test10d = "OK" : string
  618.   val fs = fn : string -> int
  619. > val test11a = "OK" : string
  620. File "testmatc.sml", line 126-129, characters 4-71:
  621. ! ....fc #"A" = 111
  622. !   | fc #"B" = 222
  623. !   | fc #"A" = 333
  624. !   | fc #"D" = 444.
  625. ! Warning: some cases are unused in this match.
  626.  
  627. File "testmatc.sml", line 126-129, characters 4-71:
  628. ! ....fc #"A" = 111
  629. !   | fc #"B" = 222
  630. !   | fc #"A" = 333
  631. !   | fc #"D" = 444.
  632. ! Warning: pattern matching is not exhaustive
  633.  
  634. > val test11b = "OK" : string
  635.   val test11c = "OK" : string
  636.   val fc = fn : char -> int
  637. > val test12a = "OK" : string
  638. File "testmatc.sml", line 137-140, characters 4-79:
  639. ! ....fw 0wx101 = 111
  640. !   | fw 0wx102 = 222
  641. !   | fw 0wx101 = 333
  642. !   | fw 0wx104 = 444.
  643. ! Warning: some cases are unused in this match.
  644.  
  645. File "testmatc.sml", line 137-140, characters 4-79:
  646. ! ....fw 0wx101 = 111
  647. !   | fw 0wx102 = 222
  648. !   | fw 0wx101 = 333
  649. !   | fw 0wx104 = 444.
  650. ! Warning: pattern matching is not exhaustive
  651.  
  652. > val test12b = "OK" : string
  653.   val test12c = "OK" : string
  654.   val test12d = "OK" : string
  655.   val test12e = "OK" : string
  656.   val fw = fn : word -> int
  657. > val test13a = "OK" : string
  658. File "testmatc.sml", line 147-151, characters 4-99:
  659. ! ....fr 101.0  = 111
  660. !   | fr 102.5  = 222
  661. !   | fr 101.0  = 333
  662. !   | fr 104.8  = 444
  663. !   | fr ~101.0 = 555.
  664. ! Warning: some cases are unused in this match.
  665.  
  666. File "testmatc.sml", line 147-151, characters 4-99:
  667. ! ....fr 101.0  = 111
  668. !   | fr 102.5  = 222
  669. !   | fr 101.0  = 333
  670. !   | fr 104.8  = 444
  671. !   | fr ~101.0 = 555.
  672. ! Warning: pattern matching is not exhaustive
  673.  
  674. > val test13b = "OK" : string
  675.   val test13c = "OK" : string
  676.   val test13d = "OK" : string
  677.   val fr = fn : real -> int
  678. > val test14a = "OK" : string
  679. File "testmatc.sml", line 162-163, characters 4-39:
  680. ! ....funit1 () = 111
  681. !   | funit1 x  = 222.
  682. ! Warning: some cases are unused in this match.
  683.  
  684. > val test14b = "OK" : string
  685.   val test14c = "OK" : string
  686.   val test14d = "OK" : string
  687.   val funit1 = fn : unit -> int
  688. File "testmatc.sml", line 165-166, characters 4-39:
  689. ! ....funit2 {} = 111
  690. !   | funit2 x  = 222.
  691. ! Warning: some cases are unused in this match.
  692.  
  693. > val funit2 = fn : unit -> int
  694. > val test20 = "OK" : string
  695. > val test21 = "OK" : string
  696. File "testmatc.sml", line 174-182, characters 4-380:
  697. ! ....berryvec #[true,  false, _    ] = 111
  698. !   | berryvec #[false, _,     true ] = 222
  699. !   | berryvec #[_,     true,  false] = 333
  700. !   | berryvec #[false, false, false] = 444
  701. !   | berryvec #[]                    = 666
  702. !   | berryvec #[true]                = 777
  703. !   | berryvec #[true, true]          = 888
  704. !   | berryvec #[true, true, true, true] = 999
  705. !   | berryvec #[true,  true,  true ] = 555
  706. ! Warning: pattern matching is not exhaustive
  707.  
  708. > val berryvec = fn : bool vector -> int
  709.   val testberryvec = "OK" : string
  710. File "testmatc.sml", line 198-199, characters 4-49:
  711. ! ....fref1 (ref ()) = 111
  712. !   | fref1 (ref x)  = 222.
  713. ! Warning: some cases are unused in this match.
  714.  
  715. > val fref1 = fn : unit ref -> int
  716. > val test30 = "OK" : string
  717. > val fref2 = fn : int list ref -> int
  718. > val test31 = "OK" : string
  719. > val dynExcon = A : exn
  720.   exn A = A : exn
  721.   exn C = C : exn
  722.   exn D = D : exn
  723. > exn B = B : exn
  724. File "testmatc.sml", line 225-228, characters 4-63:
  725. ! ....fexc1 A = 1
  726. !   | fexc1 B = 2
  727. !   | fexc1 A = 3
  728. !   | fexc1 C = 4.
  729. ! Warning: some cases are unused in this match.
  730.  
  731. File "testmatc.sml", line 225-228, characters 4-63:
  732. ! ....fexc1 A = 1
  733. !   | fexc1 B = 2
  734. !   | fexc1 A = 3
  735. !   | fexc1 C = 4.
  736. ! Warning: pattern matching is not exhaustive
  737.  
  738. > val fexc1 = fn : exn -> int
  739. > val test40a = "OK" : string
  740. > val test40b = "OK" : string
  741. > val test40c = "OK" : string
  742. > val test40d = "OK" : string
  743. > val test40e = "OK" : string
  744. > exn I = fn : int -> exn
  745.   exn R = fn : real -> exn
  746.   exn Z = fn : int -> exn
  747. File "testmatc.sml", line 243-251, characters 4-224:
  748. ! ....fexc2 (I 7)    = 111
  749. !   | fexc2 (R 1.2)  = 222
  750. !   | fexc2 (I 8)    = 333
  751. !   | fexc2 (R ~1.2) = 444
  752. !   | fexc2 (Z 9)    = 555
  753. !   | fexc2 (Fail s) = 666
  754. !   | fexc2 (R ~1.2) = 777
  755. !   | fexc2 (Z 8)    = 888
  756. !   | fexc2 _        = 999.
  757. ! Warning: some cases are unused in this match.
  758.  
  759. > val fexc2 = fn : exn -> int
  760. > val test41a = "OK" : string
  761. File "testmatc.sml", line 265-268, characters 5-71:
  762. !     ....fexc11 A = 1
  763. !       | fexc11 B = 2
  764. !       | fexc11 A = 3
  765. !       | fexc11 C = 4.
  766. ! Warning: pattern matching is not exhaustive
  767.  
  768. > val enclose42 = fn : unit -> string list
  769. > val test42 = ["OK", "OK", "OK", "OK", "OK"] : string list
  770. > val enclose43 = fn : unit -> string
  771. > val test43 = "OK" : string
  772. File "testmatc.sml", line 311, characters 13-15:
  773. !     let val [x] = xs in x end
  774. !              ^^
  775. ! Warning: pattern matching is not exhaustive
  776.  
  777. > val fbind = fn : 'a list -> 'a
  778.   val test50a = "OK" : string
  779. > val test50b = "OK" : string
  780. > val test50c = "OK" : string
  781. > val esc = fn : string -> int
  782. > val test60a = "OK" : string
  783.   val irr1 = fn : unit * int -> int
  784. > val irr2 = fn : 'a vector * int -> int
  785. > val irr3 = fn : 'a * int -> int
  786. > val test70 = true : bool
  787. [closing file "testmatc.sml"]
  788. > val it = () : unit
  789. Moscow ML version 1.42 (July 1997)
  790. Enter `quit();' to quit.
  791. - > type word8 = Word8.word
  792. - ! Toplevel input:
  793. ! fun fail1 (x : 'a) = x + x;
  794. !                      ^
  795. ! Type clash: expression of explicit type 'a
  796. ! cannot have type
  797. !   'b
  798. - ! Toplevel input:
  799. ! fun fail2 (x as (a,b,c)) = x + x;
  800. !                              ^
  801. ! Overloaded + cannot be applied to argument(s) of type 'a * 'b * 'c
  802. - ! Toplevel input:
  803. ! fun fail3 (x : bool -> bool) = x + x;
  804. !                                  ^
  805. ! Overloaded + cannot be applied to argument(s) of type bool -> bool
  806. - ! Toplevel input:
  807. ! fun fail4 (x : bool) = x + x;
  808. !                          ^
  809. ! Overloaded + cannot be applied to argument(s) of type bool
  810. - ! Toplevel input:
  811. ! fun fail5 (x : int Array.array) = x + x;
  812. !                                     ^
  813. ! Overloaded + cannot be applied to argument(s) of type int Array.array
  814. - ! Toplevel input:
  815. ! fun fail6 x = abs x before ignore (x + 0w0);
  816. !               ^^^
  817. ! Overloaded abs cannot be applied to argument(s) of type word
  818. - ! Toplevel input:
  819. ! fun fail7 x = ~ x before ignore (x + 0w0);
  820. !               ^
  821. ! Overloaded ~ cannot be applied to argument(s) of type word
  822. - ! Toplevel input:
  823. ! fun fail8 x y = x div y before ignore (y + 0.0);
  824. !                   ^^^
  825. ! Overloaded div cannot be applied to argument(s) of type real
  826. - ! Toplevel input:
  827. ! fun fail9 x y = x mod y before ignore (y + 0.0); 
  828. !                   ^^^
  829. ! Overloaded mod cannot be applied to argument(s) of type real
  830. - ! Toplevel input:
  831. ! fun fail10  x y = x + y before ignore (y ^ "");
  832. !                     ^
  833. ! Overloaded + cannot be applied to argument(s) of type string
  834. - ! Toplevel input:
  835. ! fun fail11  x y = x - y before ignore (y ^ "");
  836. !                     ^
  837. ! Overloaded - cannot be applied to argument(s) of type string
  838. - ! Toplevel input:
  839. ! fun fail12 x y = x * y before ignore (y ^ "");
  840. !                    ^
  841. ! Overloaded * cannot be applied to argument(s) of type string
  842. - ! Toplevel input:
  843. ! fun fail13 x y = x div y before ignore (y ^ "");
  844. !                    ^^^
  845. ! Overloaded div cannot be applied to argument(s) of type string
  846. - ! Toplevel input:
  847. ! fun fail14 x y = x mod y before ignore (y ^ ""); 
  848. !                    ^^^
  849. ! Overloaded mod cannot be applied to argument(s) of type string
  850. - ! Toplevel input:
  851. ! fun fail15 x = abs x before ignore (x ^ "");
  852. !                ^^^
  853. ! Overloaded abs cannot be applied to argument(s) of type string
  854. - ! Toplevel input:
  855. ! fun fail16 x = ~ x before ignore (x ^ "");
  856. !                ^
  857. ! Overloaded ~ cannot be applied to argument(s) of type string
  858. - ! Toplevel input:
  859. ! fun fail17  x y = x + y before ignore (ord y);
  860. !                     ^
  861. ! Overloaded + cannot be applied to argument(s) of type char
  862. - ! Toplevel input:
  863. ! fun fail18  x y = x - y before ignore (ord y);
  864. !                     ^
  865. ! Overloaded - cannot be applied to argument(s) of type char
  866. - ! Toplevel input:
  867. ! fun fail19 x y = x * y before ignore (ord y);
  868. !                    ^
  869. ! Overloaded * cannot be applied to argument(s) of type char
  870. - ! Toplevel input:
  871. ! fun fail20 x y = x div y before ignore (ord y);
  872. !                    ^^^
  873. ! Overloaded div cannot be applied to argument(s) of type char
  874. - ! Toplevel input:
  875. ! fun fail21 x y = x mod y before ignore (ord y); 
  876. !                    ^^^
  877. ! Overloaded mod cannot be applied to argument(s) of type char
  878. - ! Toplevel input:
  879. ! fun fail22 x = abs x before ignore (ord x);
  880. !                ^^^
  881. ! Overloaded abs cannot be applied to argument(s) of type char
  882. - ! Toplevel input:
  883. ! fun fail23 x = ~ x before ignore (ord x);
  884. !                ^
  885. ! Overloaded ~ cannot be applied to argument(s) of type char
  886. - ! Toplevel input:
  887. ! fun fail24 x = abs x before ignore (x + 0w0 : word8);
  888. !                ^^^
  889. ! Overloaded abs cannot be applied to argument(s) of type Word8.word
  890. - ! Toplevel input:
  891. ! fun fail25 x = ~ x before ignore (x + 0w0 : word8);
  892. !                ^
  893. ! Overloaded ~ cannot be applied to argument(s) of type Word8.word
  894. - ! Toplevel input:
  895. ! val fail26 = 0w1 : int;
  896. !              ^^^
  897. ! Overloaded word constant cannot have type int
  898. - ! Toplevel input:
  899. ! val fail27 = 0w1 : real;
  900. !              ^^^
  901. ! Overloaded word constant cannot have type real
  902. - ! Toplevel input:
  903. ! val fail28 = 0w1 : string;
  904. !              ^^^
  905. ! Overloaded word constant cannot have type string
  906. - ! Toplevel input:
  907. ! val fail29 = 0w1 : char;
  908. !              ^^^
  909. ! Overloaded word constant cannot have type char
  910. - ! Toplevel input:
  911. ! val fail30 = 0w1 : bool;
  912. !              ^^^
  913. ! Overloaded word constant cannot have type bool
  914. - ! Toplevel input:
  915. ! val fail31 = 0w1 : int Array.array;
  916. !              ^^^
  917. ! Overloaded word constant cannot have type int Array.array
  918. - ! Toplevel input:
  919. ! fun fail32 (x as 0w256) = [x, x, x, 0w0 : word8]
  920. !                  ^^^^^
  921. ! Word8.word constant is too large
  922. Moscow ML version 1.42 (July 1997)
  923. Enter `quit();' to quit.
  924. - ! Toplevel input:
  925. ! val fail1 = ~1073741825;
  926. !             ^^^^^^^^^^^
  927. ! Lexical error: integer constant is too large.
  928. - ! Toplevel input:
  929. ! val fail2 =  1073741824;
  930. !              ^^^^^^^^^^
  931. ! Lexical error: integer constant is too large.
  932. - ! Toplevel input:
  933. ! val fail3 = ~0x40000001;
  934. !             ^^^^^^^^^^^
  935. ! Lexical error: integer constant is too large.
  936. - ! Toplevel input:
  937. ! val fail4 =  0x40000000;
  938. !              ^^^^^^^^^^
  939. ! Lexical error: integer constant is too large.
  940. - ! Toplevel input:
  941. ! val fail5 = 0w2147483648;
  942. !             ^^^^^^^^^^^^
  943. ! Lexical error: word constant is too large.
  944. - ! Toplevel input:
  945. ! val fail6 = 0wx80000000;
  946. !             ^^^^^^^^^^^
  947. ! Lexical error: word constant is too large.
  948. - ! Toplevel input:
  949. ! val fail7 = 0w256  : Word8.word;
  950. !             ^^^^^
  951. ! Word8.word constant is too large
  952. - ! Toplevel input:
  953. ! val fail8 = 0wx100 : Word8.word;
  954. !             ^^^^^^
  955. ! Word8.word constant is too large
  956. - ! Toplevel input:
  957. ! val fail9  =  9999999999999999999999999999999999999999;
  958. !               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  959. ! Lexical error: integer constant is too large.
  960. - ! Toplevel input:
  961. ! val fail10 = ~9999999999999999999999999999999999999999;
  962. !              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  963. ! Lexical error: integer constant is too large.
  964. - ! Toplevel input:
  965. ! val fail11 =  0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
  966. !               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  967. ! Lexical error: integer constant is too large.
  968. - ! Toplevel input:
  969. ! val fail12 = ~0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
  970. !              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  971. ! Lexical error: integer constant is too large.
  972. - ! Toplevel input:
  973. ! val fail13 = 0wxFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
  974. !              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  975. ! Lexical error: word constant is too large.
  976. - ! Toplevel input:
  977. ! val fail14 = 0wxFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF : Word8.word;
  978. !              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  979. ! Lexical error: word constant is too large.
  980. Moscow ML version 1.42 (July 1997)
  981. Enter `quit();' to quit.
  982. - ! Toplevel input:
  983. ! datatype t = true;
  984. !              ^^^^
  985. ! Illegal rebinding or respecification
  986. - ! Toplevel input:
  987. ! datatype t = false;
  988. !              ^^^^^
  989. ! Illegal rebinding or respecification
  990. - ! Toplevel input:
  991. ! datatype t = it;
  992. !              ^^
  993. ! Illegal rebinding or respecification
  994. - ! Toplevel input:
  995. ! datatype t = nil;
  996. !              ^^^
  997. ! Illegal rebinding or respecification
  998. - ! Toplevel input:
  999. ! datatype t = op ::;
  1000. !              ^^^^^
  1001. ! Illegal rebinding or respecification
  1002. - ! Toplevel input:
  1003. ! datatype t = ref;
  1004. !              ^^^
  1005. ! Illegal rebinding or respecification
  1006. - ! Toplevel input:
  1007. ! datatype t = true of int;
  1008. !              ^^^^
  1009. ! Illegal rebinding or respecification
  1010. - ! Toplevel input:
  1011. ! datatype t = false of int;
  1012. !              ^^^^^
  1013. ! Illegal rebinding or respecification
  1014. - ! Toplevel input:
  1015. ! datatype t = it of int;
  1016. !              ^^
  1017. ! Illegal rebinding or respecification
  1018. - ! Toplevel input:
  1019. ! datatype t = nil of int;
  1020. !              ^^^
  1021. ! Illegal rebinding or respecification
  1022. - ! Toplevel input:
  1023. ! datatype t = op :: of int;
  1024. !              ^^^^^
  1025. ! Illegal rebinding or respecification
  1026. - ! Toplevel input:
  1027. ! datatype t = ref of int; 
  1028. !              ^^^
  1029. ! Illegal rebinding or respecification
  1030. - ! Toplevel input:
  1031. ! exception true;
  1032. !           ^^^^
  1033. ! Illegal rebinding or respecification
  1034. - ! Toplevel input:
  1035. ! exception false;
  1036. !           ^^^^^
  1037. ! Illegal rebinding or respecification
  1038. - ! Toplevel input:
  1039. ! exception it;
  1040. !           ^^
  1041. ! Illegal rebinding or respecification
  1042. - ! Toplevel input:
  1043. ! exception nil;
  1044. !           ^^^
  1045. ! Illegal rebinding or respecification
  1046. - ! Toplevel input:
  1047. ! exception op ::;
  1048. !           ^^^^^
  1049. ! Illegal rebinding or respecification
  1050. - ! Toplevel input:
  1051. ! exception ref;
  1052. !           ^^^
  1053. ! Illegal rebinding or respecification
  1054. - ! Toplevel input:
  1055. ! exception true = Div;
  1056. !           ^^^^
  1057. ! Illegal rebinding or respecification
  1058. - ! Toplevel input:
  1059. ! exception false = Div;
  1060. !           ^^^^^
  1061. ! Illegal rebinding or respecification
  1062. - ! Toplevel input:
  1063. ! exception it = Div;
  1064. !           ^^
  1065. ! Illegal rebinding or respecification
  1066. - ! Toplevel input:
  1067. ! exception nil = Div;
  1068. !           ^^^
  1069. ! Illegal rebinding or respecification
  1070. - ! Toplevel input:
  1071. ! exception op :: = Div;
  1072. !           ^^^^^
  1073. ! Illegal rebinding or respecification
  1074. - ! Toplevel input:
  1075. ! exception ref = Div;
  1076. !           ^^^
  1077. ! Illegal rebinding or respecification
  1078. - ! Toplevel input:
  1079. ! exception true of int;
  1080. !           ^^^^
  1081. ! Illegal rebinding or respecification
  1082. - ! Toplevel input:
  1083. ! exception false of int;
  1084. !           ^^^^^
  1085. ! Illegal rebinding or respecification
  1086. - ! Toplevel input:
  1087. ! exception it of int;
  1088. !           ^^
  1089. ! Illegal rebinding or respecification
  1090. - ! Toplevel input:
  1091. ! exception nil of int;
  1092. !           ^^^
  1093. ! Illegal rebinding or respecification
  1094. - ! Toplevel input:
  1095. ! exception op :: of int;
  1096. !           ^^^^^
  1097. ! Illegal rebinding or respecification
  1098. - ! Toplevel input:
  1099. ! exception ref of int; 
  1100. !           ^^^
  1101. ! Illegal rebinding or respecification
  1102. - ! Toplevel input:
  1103. ! abstype t = true of int with end;
  1104. !             ^^^^
  1105. ! Illegal rebinding or respecification
  1106. - ! Toplevel input:
  1107. ! abstype t = false of int with end;
  1108. !             ^^^^^
  1109. ! Illegal rebinding or respecification
  1110. - ! Toplevel input:
  1111. ! abstype t = it of int with end;
  1112. !             ^^
  1113. ! Illegal rebinding or respecification
  1114. - ! Toplevel input:
  1115. ! abstype t = nil of int with end;
  1116. !             ^^^
  1117. ! Illegal rebinding or respecification
  1118. - ! Toplevel input:
  1119. ! abstype t = op :: of int with end;
  1120. !             ^^^^^
  1121. ! Illegal rebinding or respecification
  1122. - ! Toplevel input:
  1123. ! abstype t = ref of int with end;  
  1124. !             ^^^
  1125. ! Illegal rebinding or respecification
  1126. Moscow ML version 1.42 (July 1997)
  1127. Enter `quit();' to quit.
  1128. - > val it = fn : 'a -> (('a -> 'b) -> 'b)
  1129. - ! Toplevel input:
  1130. !   f 3
  1131. !     ^
  1132. ! Type clash: expression of type
  1133. !   int
  1134. ! cannot have type
  1135. !   int -> 'a
  1136. - > val g = fn : 'a list -> int
  1137. - > val h = fn : int list -> int
  1138. - ! Toplevel input:
  1139. !   | k (x::xs) = 1 + k[7,9] + k[true];
  1140. !                                ^^^^
  1141. ! Type clash: expression of type
  1142. !   bool
  1143. ! cannot have type
  1144. !   int
  1145. - ! Toplevel input:
  1146. ! (fn x => let val y : 'aaa = x in y y end) 5;
  1147. !                             ^
  1148. ! Type clash: expression of type
  1149. !   'a
  1150. ! cannot have explicit type 'aaa
  1151. - ! Toplevel input:
  1152. ! val x = (let val Id : 'z -> 'z = fn z => z in Id Id end,
  1153. !                                                  ^^
  1154. ! Type clash: expression of type
  1155. !   'z -> 'z
  1156. ! cannot have explicit type 'z
  1157. - ! Toplevel input:
  1158. !   (f {lab1=88, lab2="a"}, f {lab1=99, lab2=true})
  1159. !                                            ^^^^
  1160. ! Type clash: expression of type
  1161. !   bool
  1162. ! cannot have type
  1163. !   string
  1164. - ! Toplevel input:
  1165. !         | mcurryAcc k xs = fn x => mcurryAcc (k-1) (x::xs)
  1166. !                                    ^^^^^^^^^^^^^^^^^^^^^^^
  1167. ! Type clash: expression of type
  1168. !   'a -> 'b
  1169. ! cannot have type
  1170. !   'b
  1171. ! because of circularity
  1172. Moscow ML version 1.42 (July 1997)
  1173. Enter `quit();' to quit.
  1174. - ! Toplevel input:
  1175. ! fun f1 x = (x=x, x 1);
  1176. !                  ^
  1177. ! Type clash: expression of equality type ''a
  1178. ! cannot have type
  1179. !   'b -> 'c
  1180. - ! Toplevel input:
  1181. ! fun f2 x = (x 1, x=x);
  1182. !                  ^
  1183. ! Type clash: expression of type
  1184. !   int -> 'a
  1185. ! cannot have equality type ''b
  1186. - ! Toplevel input:
  1187. ! fun f3a x = f3a [x];
  1188. !                  ^
  1189. ! Type clash: expression of type
  1190. !   'a list
  1191. ! cannot have type
  1192. !   'a
  1193. ! because of circularity
  1194. - ! Toplevel input:
  1195. ! fun f3b (x : 'a) = f3b [x];
  1196. !                         ^^
  1197. ! Type clash: expression of type
  1198. !   'b list
  1199. ! cannot have explicit type 'a
  1200. - ! Toplevel input:
  1201. ! fun f3c x = (x=x, f3c [x]);
  1202. !                   ^^^^^^^
  1203. ! Type clash: expression of type
  1204. !   bool * 'a
  1205. ! cannot have type
  1206. !   'a
  1207. ! because of circularity
  1208. - ! Toplevel input:
  1209. ! fun f4 [x] = f4 x;
  1210. !                 ^
  1211. ! Type clash: expression of type
  1212. !   'a
  1213. ! cannot have type
  1214. !   'a list
  1215. ! because of circularity
  1216. - ! Toplevel input:
  1217. ! fun f5 (SOME x) = f5 x;
  1218. !                      ^
  1219. ! Type clash: expression of type
  1220. !   'a
  1221. ! cannot have type
  1222. !   'a option
  1223. ! because of circularity
  1224. - ! Toplevel input:
  1225. ! fun f6 (x, y, z) = f6([x], x, x);
  1226. !                        ^
  1227. ! Type clash: expression of type
  1228. !   'a list
  1229. ! cannot have type
  1230. !   'a
  1231. ! because of circularity
  1232. - ! Toplevel input:
  1233. ! fun f7 [x : bool] = f7 x ;
  1234. !                        ^
  1235. ! Type clash: expression of type
  1236. !   bool
  1237. ! cannot have type
  1238. !   bool list
  1239. - ! Toplevel input:
  1240. ! fun f8a (x : 'a) = x=x;
  1241. !                    ^
  1242. ! Type clash: expression of type
  1243. !   'a
  1244. ! cannot have equality type ''a
  1245. - ! Toplevel input:
  1246. ! fun f8b (x : '_a) = x=x;
  1247. !                     ^
  1248. ! Type clash: expression of type
  1249. !   'a
  1250. ! cannot have equality type ''a
  1251. - ! Toplevel input:
  1252. ! fun f9 {x, ...} = f9 x;
  1253. !                      ^
  1254. ! Type clash: expression of type
  1255. !   'a
  1256. ! cannot have type
  1257. !   {x : 'a, ...}
  1258. ! because of circularity
  1259. - ! Toplevel input:
  1260. ! fun f10 (r as {a, b, c}) = r = {d=2};
  1261. !                                ^^^^^
  1262. ! Type clash: expression of type
  1263. !   {d : 'a}
  1264. ! cannot have type
  1265. !   {a : ''b, b : ''c, c : ''d}
  1266. ! because record label  a  is missing
  1267. - ! Toplevel input:
  1268. ! fun f11 x = #11 = #11;
  1269. !             ^^^
  1270. ! Type clash: match rule of type
  1271. !   'a -> 'b
  1272. ! cannot have equality type ''c
  1273. - ! Toplevel input:
  1274. ! fun f12a (x as {u, v}) = #w x;
  1275. !                             ^
  1276. ! Type clash: expression of type
  1277. !   {u : 'a, v : 'b}
  1278. ! cannot have type
  1279. !   {u : 'a, v : 'b, w : 'c, ...}
  1280. ! because record label  w  is missing
  1281. - ! Toplevel input:
  1282. ! fun f12b (x as {u, v}) = #3 x;
  1283. !                             ^
  1284. ! Type clash: expression of type
  1285. !   {u : 'a, v : 'b}
  1286. ! cannot have type
  1287. !   {u : 'a, v : 'b, 3 : 'c, ...}
  1288. ! because record label  3  is missing
  1289. - ! Toplevel input:
  1290. ! fun f13 (x as {u, v}) = x = {z = 12};
  1291. !                             ^^^^^^^^
  1292. ! Type clash: expression of type
  1293. !   {z : 'a}
  1294. ! cannot have type
  1295. !   {u : ''b, v : ''c}
  1296. ! because record label  u  is missing
  1297. - ! Toplevel input:
  1298. ! fun f14 (x as (u, v)) = x = ([1],2,3);
  1299. !                             ^^^^^^^^^
  1300. ! Type clash: expression of type
  1301. !   'a * 'b * 'c
  1302. ! cannot have type
  1303. !   ''d * ''e
  1304. ! because the tuple has the wrong number of components
  1305. - ! Toplevel input:
  1306. ! fun f14 (x as (u, v)) = #3 x;
  1307. !                            ^
  1308. ! Type clash: expression of type
  1309. !   'a * 'b
  1310. ! cannot have type
  1311. !   {1 : 'a, 2 : 'b, 3 : 'c, ...}
  1312. ! because record label  3  is missing
  1313. - ! Toplevel input:
  1314. ! val f15 = (let val Id : 'a -> 'a = fn z => z in Id Id end,
  1315. !                                                    ^^
  1316. ! Type clash: expression of type
  1317. !   'a -> 'a
  1318. ! cannot have explicit type 'a
  1319.